package com.example.demo.service.dataSource1.impl;

import com.example.demo.dao.dataSource1.GeographyMapper;
import com.example.demo.entity.bean.dataSource1.GeographyBean;
import com.example.demo.service.dataSource1.interfaces.IGeographyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Wen Gao on 2018/7/17.
 */
@Service
@Transactional(transactionManager = "xatx", propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class GeographyService implements IGeographyService {

    @Autowired
    GeographyMapper geographyMapper;

    public GeographyBean getGeographyBeanByCode(String code) {
        return GeographyBean.adapt(geographyMapper.selectByCode(code));
    }
}
